home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / GLOBAL.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  5KB  |  184 lines

  1. /*    SCCS Id: @(#)global.h    3.0    89/11/08
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef GLOBAL_H
  6. #define    GLOBAL_H
  7.  
  8. #include <stdio.h>
  9.  
  10.  
  11. /* #define BETA        /* if a beta-test copy  [MRS] */
  12. #define VERSION "3.0i"  /* version number. */
  13.  
  14. /*
  15.  * Files expected to exist in the playground directory.
  16.  */
  17.  
  18. #define RECORD        "record"  /* a file containing list of topscorers */
  19. #define    HELP        "help"      /* a file containing command descriptions */
  20. #define    SHELP        "hh"          /* abbreviated form of the same */
  21. #define    RUMORFILE    "rumors"    /* a file with fortune cookies */
  22. #define ORACLEFILE    "oracles"    /* a file with oracular information */
  23. #define    DATAFILE    "data"    /* a file giving the meaning of symbols used */
  24. #define CMDHELPFILE    "cmdhelp"    /* file telling what commands do */
  25. #define HISTORY        "history"    /* a file giving nethack's history */
  26. #define LICENSE        "license"    /* file with license information */
  27. #define OPTIONFILE    "opthelp"    /* a file explaining runtime options */
  28. #ifdef MACOS
  29. #define MACHELP        "MacHelp"    /* file with Macintosh information */
  30. #endif
  31.  
  32.  
  33. /* Assorted definitions that may depend on selections in config.h. */
  34.  
  35. /*
  36.  * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
  37.  * with Microport SysV/AT, which have small symbol tables;
  38.  * DUMB if needed is defined in CFLAGS
  39.  */
  40. #ifdef DUMB
  41. #ifdef BITFIELDS
  42. #undef BITFIELDS
  43. #endif
  44. #ifndef STUPID
  45. #define STUPID
  46. #endif
  47. #ifndef STUPID_CPP
  48. #define STUPID_CPP
  49. #endif
  50. #endif    /* DUMB */
  51.  
  52. /*
  53.  * type xchar: small integers in the range 0 - 127, usually coordinates
  54.  * although they are nonnegative they must not be declared unsigned
  55.  * since otherwise comparisons with signed quantities are done incorrectly
  56.  */
  57. typedef schar    xchar;
  58. typedef    xchar    boolean;        /* 0 or 1 */
  59.  
  60. #ifndef MACOS
  61. #ifndef TRUE        /* defined in some systems' native include files */
  62. #define    TRUE    ((boolean)1)
  63. #define    FALSE    ((boolean)0)
  64. #endif
  65. #endif
  66.  
  67. #ifdef BITFIELDS
  68. #define    Bitfield(x,n)    unsigned x:n
  69. #else
  70. #define    Bitfield(x,n)    uchar x
  71. #endif
  72.  
  73. /*
  74.  * According to ANSI, prototypes for old-style declarations must widen the
  75.  * arguments to int.  However, the MSDOS compilers accept shorter arguments
  76.  * (char, short, etc.) in prototypes and do typechecking with them.  Therefore
  77.  * this mess to allow the better typechecking while also allowing some
  78.  * prototypes for the ANSI compilers so people quit trying to fix the prototypes
  79.  * to match the standard and thus lose the typechecking.
  80.  */
  81. #if (defined(MSDOS) && !defined(TOS)) || defined (AMIGA) || defined(THINKC4) || defined(VAXC)
  82. # define CHAR_P char
  83. # define SCHAR_P schar
  84. # define UCHAR_P uchar
  85. # define XCHAR_P xchar
  86. # define BOOLEAN_P boolean
  87. #else
  88. # ifdef __STDC__
  89. #  define CHAR_P int
  90. #  define SCHAR_P int
  91. #  define UCHAR_P int
  92. #  define XCHAR_P int
  93. #  define BOOLEAN_P int
  94. # endif
  95. #endif
  96.  
  97.  
  98. #define    SIZE(x)    (int)(sizeof(x) / sizeof(x[0]))
  99.  
  100. /* (No, LARGEST_INT doesn't have to correspond to the largest integer on
  101.  * a particular machine.)
  102.  */
  103. #define LARGEST_INT    ((1 << 15) - 1)
  104.  
  105.  
  106. #ifdef STRONGHOLD
  107. # ifdef ALTARS
  108. #  ifdef THEOLOGY
  109. #define ENDGAME
  110. #  endif
  111. # endif
  112. #endif
  113.  
  114. #ifdef REDO
  115. #define Getchar pgetchar
  116. #endif
  117.  
  118. /*
  119.  * Automatic inclusions for the subsidiary files.
  120.  * Please don't change the order.  It does matter.
  121.  */
  122.  
  123. #ifndef COORD_H
  124. #include "coord.h"
  125. #endif
  126.  
  127. #if defined(VMS) && !defined(VMSCONF_H)
  128. # include "vmsconf.h"
  129. #endif
  130.  
  131. #if defined(UNIX) && !defined(UNIXCONF_H)
  132. # include "unixconf.h"
  133. #endif
  134.  
  135. #if defined(MSDOS) && !defined(PCCONF_H)
  136. # include "pcconf.h"
  137. #endif
  138.  
  139. #if defined(TOS) && !defined(TOSCONF_H)
  140. # include "tosconf.h"
  141. #endif
  142.  
  143. #if defined(AMIGA) && !defined(AMICONF_H)
  144. # include "amiconf.h"
  145. #endif
  146.  
  147. #if defined(MACOS) && !defined(MACCONF_H)
  148. # include "macconf.h"
  149. #endif
  150.  
  151.  
  152. /*
  153.  * Configurable internal parameters.
  154.  *
  155.  * Please be very careful if you are going to change one of these.  Any
  156.  * changes in these parameters, unless properly done, can render the
  157.  * executable inoperative.
  158.  */
  159.  
  160. /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
  161. #define    COLNO    80
  162. #define    ROWNO    21
  163.  
  164. #define    MAXNROFROOMS    20    /* max number of rooms per level */
  165. #define    DOORMAX        120    /* max number of doors per level */
  166.  
  167. #define    BUFSZ        256    /* for getlin buffers */
  168.  
  169. #define    PL_NSIZ        32    /* name of player, ghost, shopkeeper */
  170. #define    PL_CSIZ        20    /* sizeof pl_character */
  171. #define PL_FSIZ        32    /* fruit name */
  172.  
  173. #define    MAXLEVEL    50    /* max number of levels in the dungeon */
  174. #ifdef ENDGAME
  175. #define ENDLEVEL (MAXLEVEL+1)    /* endgame level */
  176. #endif
  177. #define HELLLEVEL    30    /* first hell level (varies ifdef STRONGHOLD) */
  178. #define    MAXULEV        30    /* max character experience level */
  179.  
  180. #define    MAXMONNO    120    /* geno monst after this number killed */
  181. #define MHPMAX        500    /* maximum monster hp */
  182.  
  183. #endif /* GLOBAL_H /**/
  184.